<head>
	<title><? echo $incident_title;?></title>
	<meta property="og:title" content="<? echo $incident_title;?>"/>
	<meta property="og:description" content="<? echo $incident_description;?>"/>   
</head>

<div id="main" class="report_detail">
	<div>

		<div class="credibility" style="float:right; border:none; margin:0px; padding:0px;">
			<table class="rating-table" cellspacing="0" cellpadding="0" border="0">
				<tr style="margin-right:0px;">
					<td></td>
					<td>
					<?php
						if ($incident_verified)
						{
							echo '<p class="r_verified">'.Kohana::lang('ui_main.verified').'</p>';
						}
						else
						{
							echo '<p class="r_unverified">'.Kohana::lang('ui_main.unverified').'</p>';
						}		
					?>
					</td>
					<td>
					<?php
						if ($incident_ticket != NULL)
						{
							echo '<p class="r_ticket">'.$incident_ticket.'</p>';
						}
					?>
					</td>
				</tr>
				<tr style="height:35px;">
					<td style="vertical-align:bottom;"><a href="" id="oloader_<?php echo $incident_id; ?>" class="rating_loading" ></a></td>
					<?php 
					if ($imgvote)
					{
					?>
						<td style="vertical-align:middle;"><a href="javascript:rating('<?php echo $incident_id; ?>','add','original','oloader_<?php echo $incident_id; ?>')"><img style="float:right" id="oup_<?php echo $incident_id; ?>" src="<?php echo $imgvote?>" alt="UP" title="UP" border="0" /></a></td>
					<?php
					}
					else
					{
					?>
						<td style="vertical-align:middle;"><a href="javascript:rating('<?php echo $incident_id; ?>','add','original','oloader_<?php echo $incident_id; ?>')"><img style="float:right" id="oup_<?php echo $incident_id; ?>" src="<?php echo $imgvote?>" alt="UP" title="UP" border="0" /></a></td>
					<?php
					}
					?>
					<td><span class="r_fecini" style="font-size:18px;" class="rating_value" id="orating_<?php echo $incident_id; ?>">&nbsp;&nbsp;&nbsp;<?php echo $incident_rating; ?> &nbsp;&nbsp;</span></td>
				</tr>
			</table>
		</div>
		

		<h1 class="report-title">
		<?php 
			foreach($incident_category as $category) 
			{

				// don't show hidden categoies
				if($category->category->category_visible == 0)
				{
					continue;
				}

				if ($category->category->category_image_thumb)
				{
		?>
					<a href="<?php echo url::site()."reports/?c=".$category->category->id; ?>"><span class="r_cat-box" style="background:transparent url(<?php echo url::base().Kohana::config('upload.relative_directory')."/".$category->category->category_image; ?>) 0 0 no-repeat;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></a>
				
		<?php 
				}
				else
				{
		?>
					<a href="<?php echo url::site()."reports/?c=".$category->category->id; ?>"><span class="r_cat-box" style="background-color:#<?php echo $category->category->category_color; ?>">&nbsp;&nbsp;&nbsp;</span></a>
		<?php
				}
			}
		
			echo $incident_title;
			
			// If Admin is Logged In - Allow For Edit Link
			if ($logged_in)
			{
				echo " [&nbsp;<a href=\"".url::site()."admin/reports/edit/".$incident_id."\">".Kohana::lang('ui_main.edit')."</a>&nbsp;]";
			}
		?>
		</h1>
		<p class="report-when-where">
			<span class="r_date"><?php echo $incident_time.' '.$incident_date; ?> </span>
			<span class="r_location"><?php echo $incident_location; ?></span>
		</p>
	
		<div class="report-category-list" style="border:none;">

			<?php
			// Action::report_meta - Add Items to the Report Meta (Location/Date/Time etc.)
			Event::run('ushahidi_action.report_meta', $incident_id);
			?>
		</div>	
	</div>

	<div id="report-map" class="report-map">
		<div class="map-holder" id="map" style="width:930px;height:350px;"></div>
		<!--ul class="map-toggles">
			<li style="display:block;"><a href="#" class="smaller-map">Smaller map</a></li>
			<li><a href="#" class="wider-map">Wider map</a></li>
			<li><a href="#" class="taller-map">Taller map</a></li>
			<li><a href="#" class="shorter-map">Shorter Map</a></li>
		</ul-->
		<div style="clear:both"></div>
	</div>
			
	<div class="left-col" style="float:left;width:480px; margin-right:20px">
		<div class="report-description-text">
			<h5 style="font-size:16px;border-bottom:2px solid #C0C2B8;">
				<?php echo Kohana::lang('ui_main.reports_description');?>
			</h5>
			<spam style="font-size:14px;"> <br><?php echo $incident_description; ?> </spam>
			<br/>	

		</div>
	
		
		<div style="padding-bottom:30px;">
		
			<?php 
			if ($features_count)
			{
			?>
				<br /><br />
				<h5>
					<?php echo Kohana::lang('ui_main.reports_features');?>
				</h5>
				<?php
				foreach ($features as $feature)
				{
					echo ($feature->geometry_label) ?
					 	"<div class=\"feature_label\"><a href=\"javascript:getFeature($feature->id)\">$feature->geometry_label</a></div>" : "";
					echo ($feature->geometry_comment) ?
						"<div class=\"feature_comment\">$feature->geometry_comment</div>" : "";
				}
			}?>
			
		</div>
		
		<?php
            // Action::report_extra - Allows you to target an individual report right after the description
            Event::run('ushahidi_action.report_extra', $incident_id);

			// Filter::comments_block - The block that contains posted comments
			Event::run('ushahidi_filter.comment_block', $comments);
			echo $comments;
		?>
		
		<?php
			// Filter::comments_form_block - The block that contains the comments form
			Event::run('ushahidi_filter.comment_form_block', $comments_form);
			echo $comments_form;
		?>
	
	</div>
	
	<div style="float:left;width:420px;">

		<div class="report-additional-reports report-description-text" style="float:left; border:1px;">
			<h5 style="font-size:16px;border-bottom:2px solid #C0C2B8;">
				<?php echo Kohana::lang('ui_main.status');?>
			</h5>
			<div style="width:380px;"></div>
			<br/>	
			<!--h4 style="font-size:16px; font-weight: bold;"><?php echo Kohana::lang('ui_main.status');?></h4-->
			<!--div style="height:66px; width:428px;"-->
			<img border="0" src="<?php echo $imgestatus; ?>">
			<!--/div-->
			
			<div style="margin-top:20px;">
				<div class="rb_report" style="border-top:none; border-bottom: 1px none #C0C2B8;">
				<h4 class = "r_fecini" style="font-size:16px;"><?php echo Kohana::lang('ui_main.dateini').'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.$incident_date; ?></h4>
				</div>
				<div class="rb_report"  style="border-top:none; border-bottom: 1px none #C0C2B8;">
				<h4 class = "r_dias" style="font-size:16px;background-color:<?php echo $color_estatus; ?>;"><?php echo Kohana::lang('ui_main.datedays').'&nbsp;'.$incident_days; ?></h4>
				</div>
				<div class="rb_report"  style="border-top:none; border-bottom: 1px none #C0C2B8;<?php echo $incident_closed ?>">
				<h4 class = "r_fecfin" style="font-size:16px;<?php echo $incident_closed ?>"><?php echo Kohana::lang('ui_main.datefin').'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.$incident_dateclosed; ?></h4>
				</div>
			</div>

			<div class="rb_report"  style="border-top:none; border-bottom: 1px none #C0C2B8;">
			<?php
				echo '<br><spam class="r_verified">'.Kohana::lang('ui_main.on_time').'</spam>';
				echo '<spam class="r_unverified">'.Kohana::lang('ui_main.delayed').'</spam>';
			?>
			</div>
		</div>

		<div class="report-media-box-tabs">
			<ul>
				<!--li class="report-tab-selected">
					<a class="tab-item" href="#report-map"><?php echo Kohana::lang('ui_main.map');?></a>
				</li-->
				<?php
				$tab = '"class="report-tab-selected"';
				?>
				<?php if( count($incident_photos) > 0 ) { ?>
					<li <?php echo $tab; ?>>
						<a class="tab-item" href="#report-images"><?php echo Kohana::lang('ui_main.images');?></a>
					</li>
				<?php } 
				$tab = '';
				?>
				<?php if( count($incident_videos) > 0 ) { ?>
					<li <?php echo $tab; ?>>
						<a class="tab-item" href="#report-video"><?php echo Kohana::lang('ui_main.video');?></a>
					</li>
				<?php } 
				$tab = '';
				?>
				<?php if( count($incident_news) > 0 ) { ?>
					<li <?php echo $tab; ?>>
						<a class="tab-item" href="#report-news"><?php echo Kohana::lang('ui_main.news');?></a>
					</li>
				<?php } 
				$tab = '';
				?>
			</ul>
		</div>
		
		<div class="report-media-box-content">
			<!-- start images -->
			<?php 
			if( count($incident_photos) > 0 ) 
			{ 
			?>
			<div id="report-images" style="display:none;">
			<?php
				foreach ($incident_photos as $photo)
				{
					if ((substr($photo, 0, 4)) != 'http')
					{
						$thumb = str_replace(".","_t.",$photo);
						$prefix = url::base().Kohana::config('upload.relative_directory');
						echo '<a class="photothumb" rel="lightbox-group1" href="'.$prefix.'/'.$photo.'"><img src="'.$prefix.'/'.$thumb.'"/></a> ';
					}
					else
					{
						echo '<a class="photothumb" rel="lightbox-group1" href="'.$photo.'"><img src="'.$photo.'" width="79px" height="59px"/></a> ';
					}
				}
			?>
			</div>
			<?php 
			} 
			?>
			<!-- end images -->
			
			<!-- start videos -->
			<?php if( count($incident_videos) > 0 ) { ?>
				<div id="report-video" style="display:none;">
					<?php
						// embed the video codes
						foreach( $incident_videos as $incident_video) {
							$videos_embed->embed($incident_video,'');
						}
					?>
				</div>
			<?php } ?>
			<!-- end videos -->
			
			<!-- start news source link -->
			<?php 
			if( count($incident_news) > 0 ) 
			{ 
			?>
				<div id="report-news" style="display:none;">>
					<?php 
					foreach( $incident_news as $incident_new) 
					{
					?>
						<a href="<?php echo $incident_new; ?>">
							<?php echo $incident_new;?>
						</a>
						<br/>
					<?php	
					}
					?>
				</div>
			<?php
			} 
			?>
			<!-- end news source link -->
		
		</div>

	</div>
	
	<div style="clear:both;"></div>
	
	
	
	
</div>
